# Require the application
require './app'

# Make the file manager library available to Rake tasks
require "#{File.dirname(__FILE__)}/file_manager"

# Fix for Rake v10+ not using the top level DSL
class Sinatra::Application
  extend Rake::DSL if defined? Rake::DSL
end

# Import the Chassis tasks
Dir[File.join(File.dirname(__FILE__) + "/../tasks/**/*.rake")].each { |file| import file }

# Import Chassis extension gem tasks
Gem.loaded_specs.values.each do |v|
  Dir["#{v.full_gem_path}/lib/chassis/tasks/**/*.rake"].each { |file| import file }
end

# Import tasks from the app
Dir["./tasks/**/*.rake"].each { |file| import file }
